﻿using Pay.DTO;
using Pay.TO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.IService {
    public interface ITokenTransferService {
        /// <summary>
        /// token提现列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<token_transfer_dto> Gets(TokenTansferQuery query);
        /// <summary>
        /// 提现
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        token_transfer_dto Get(long id);
        /// <summary>
        /// 提现审核详情
        /// </summary>
        /// <param name="id"></param>
        /// <param name="queryPage"></param>
        /// <returns></returns>
        token_transfer_dto_ex GetDetail(long id, PageQuery queryPage);
        /// <summary>
        /// 获取提现记录
        /// </summary>
        /// <param name="merchant_no"></param>
        /// <param name="order_no"></param>
        /// <returns></returns>
        token_transfer_dto Get(string merchant_no, string order_no);
        /// <summary>
        /// 提现审核
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool Audit(token_transfer_model model);
        /// <summary>
        /// 修改银行卡
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool UpdateBank(token_tranfer_bank_model model);
        /// <summary>
        /// 钱包
        /// </summary>
        /// <param name="merchantId"></param>
        /// <returns></returns>
        List<token_wallet_dto> GetWallet(long merchantId);
        /// <summary>
        /// 钱包收益详情
        /// </summary>
        /// <param name="mechantId"></param>
        /// <param name="type">1 分销 2 课程 3 店铺</param>
        /// <returns></returns>
        token_wallet_detail_dto GetWalletDetail(long mechantId, int type);
        /// <summary>
        /// 获取提现记录
        /// </summary>
        /// <param name="merchant_no"></param>
        /// <param name="pay_no"></param>
        /// <returns></returns>
        token_transfer_dto GetByPayNo(string merchant_no, string pay_no);
        /// <summary>
        /// 申请提现
        /// </summary>
        /// <param name="merchant_id"></param>
        /// <param name="type"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        int ApplyTokenTransfer(long merchant_id, int type, decimal amount);
        /// <summary>
        /// 提现成功
        /// </summary>
        /// <param name="transfer"></param>
        /// <returns></returns>
        int TransferSuccess(platform_transfer transfer);
        /// <summary>
        /// 提现失败
        /// </summary>
        /// <param name="transfer"></param>
        /// <returns></returns>
        int TransferFail(platform_transfer transfer);
        /// <summary>
        /// 下发
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        int ReTokenTransfer(platform_transfer dto);

        /// <summary>
        /// 手动输入付款单号
        /// </summary>
        /// <param name="id"></param>
        /// <param name="transaction_no"></param>
        /// <returns></returns>
        int UpdateEx(long id, string transaction_no);
        /// <summary>
        /// 提现记录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        PagedResult<token_deposited_dto> GetDeposited(WalletQuery query);
    }
}
